﻿import php.Lib;
import php.db.Manager;

class Main
{
static function main() 
	{  
		try 
		{
			var connection = php.db.Mysql.connect(Configuration.getDbParams());
			connection.request("SET NAMES 'utf8';");
			Manager.cnx = connection;
		} catch (e: Dynamic) { trace(e); return;	}
		
		try{
			var psr=new RSSParser('http://lenta.ru/rss/');
			
			for (it in psr.getItems())
			{
				it.insert();
			}
		}catch (e:String) { trace(e); }
	}
}